package com.jun.common.core.entity.page;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author yuejun.li
 * @date 2023/7/10 10:27:23
 * 返回码
 */
@Getter
@AllArgsConstructor
public enum ResultCode {

    /**
     * 默认的请求成功错误码
     */
    SUCCESS(200, "success"),
    ERROR(505, "error"),
    /**
     * 默认的请求失败错误码
     */
    SYSTEM_ERROR(-1, "系统错误"),
    FAILED(1, "操作失败"),
    OBJECT_ALREADY_EXISTS(2, "对象已存在"),
    TOKEN_EXPIRED(3, "TOKEN过期"),
    TOKEN_ERROR(4, "TOKEN信息错误"),
    STATUS_CHANGED(5, "状态已变更"),
    STATUS_ERROR(6, "状态错误"),
    STATUS_LOCKED(7, "状态锁定"),
    OBJECT_NOT_EXISTS(8, "对象不存在"),
    INTERNAL_ERROR(9, "内部错误"),
    FORBIDDEN(10, "权限拒绝"),
    UNAUTHORIZED(11, "暂未登录或token已经过期"),
    OBJECT_INVALID(1001, "对象已失效"),
    IDENTITY_ERROR(1002, "姓名和身份证号不匹配"),
    CHECK_IDENTITY_FAIL(1003, "校验失败"),
    USER_INFO_EMPTY(1004, "用户信息为空"),
    PARAM_IS_NULL(1005, "参数为空"),
    PARAMETER_ERROR(1006, "参数错误"),
    VALIDATE_FAILED(1007, "参数检验失败"),
    FAIL_SERVER(500, "服务器异常");

    private int code;

    private String message;
}
